package com.rran.study.designpattern.behavioral.observer.listener.app;

import com.rran.study.designpattern.behavioral.observer.event.app.OrderEvent;
import com.rran.study.designpattern.behavioral.observer.model.OrderData;

/**
 * @author yy
 * @Type AppPayListener.java
 * @Desc OrderEvent监听者--支付
 * @date 2020/7/21 19:42
 */
public class AppPayListener implements AppListener<OrderEvent> {
    @Override
    public void applicationEvent(OrderEvent event) {
        this.payMoney(event.getSource());
    }

    /**
     * 支付
     */
    private void payMoney(OrderData orderData) {
        System.out.println("支付观察者：支付成功" + orderData.getMoney() + "元");
    }

}
